#include <bits/stdc++.h>
using namespace std;
const int MAXN=2e5+10;
vector<int> odd;
vector<int> even;
vector<vector<int>> gra(MAXN);
vector<int> ans(MAXN,0);
int n;
void bfs(vector<int> start,vector<int> end){
    queue<int> q;
    int dist[MAXN];
    memset(dist,-1,sizeof(dist));
    for(auto it:start){
        dist[it]=0;
        q.push(it);
    }
    while(!q.empty()){
        int u=q.front();q.pop();
        for(int i=0;i<(int)gra[u].size();i++){
            int nx=gra[u][i];
            if(dist[nx]==-1){
                dist[nx]=dist[u]+1;
                q.push(nx);
            }
        }
    }
    for(auto it:end){
        ans[it]=dist[it];
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
    cout<<"\n";
}
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        int t;cin>>t;
        if(t&1)odd.push_back(i);
        else even.push_back(i);
        if(i+t<n)gra[i+t].emplace_back(i);
        if(i-t>=0)gra[i-t].emplace_back(i);
    }
    bfs(odd,even);
    bfs(even,odd);
    for(int i=0;i<n;i++)cout<<ans[i]<<" ";
    cout<<endl;
	return 0;
}
